<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link href="Doc.css" rel="stylesheet"/>
<title>TreeGrid - Printing</title>
</head>
<body>
<div class="Doc">


<h1>Print grid</h1>
<p>TreeGrid documentation</p>

User can print grid by clicking to Print button on toolbar.<br />
TreeGrid opens new window and renders here the grid again and calls standard window.<b>print</b> method to show printing dialog and print the grid. The printing process itself cannot be controlled by JavaScript at all.<br />
<br />

In TreeGrid print menu it is possible to choose which columns or rows to print and set various printing options. <br />
See <a href="GlobalSettings.htm#CfgMenu">Configuration menu</a> for basic settings or <a href="GlobalSettings.htm#MenuPrint">Print menu</a> for special settings.<br />
<br />

The grid rendered for printing does not show scrollbars, but displays the whole grid. It does not show right side pager. All other parts visibility can be controlled by <b>CanPrint</b> attributes.<br />
More changes for printing can be done by &lt;<a href="Media.htm#Media">Media</a>>&lt;M <a href="Media.htm#MMedia">Media</a>='<b>Print</b>' ... />&lt;Media>.<br />
<br />
<i>Because TreeGrid uses background images, a user must have permitted "<b>Printing background images</b>" in his browser to successfully print the grid.</i><br />

<!-- PrintLocation -->
<a name="CfgPrintLocation"></a>
<div class="XML">
   <u>new <b>7.1</b> chg <b>12.1</b> <i>upd <b>13.2</b></i></u> <b>&lt;Cfg></b> <i>int</i>
   <h4>PrintLocation</h4> <s>[3/0]</s>
</div>
Where the printable grid will be shown<br />
<b>0</b> - new window with PrintWindowProp properties<br />
<b>1</b> - new window with the same properties as the main window, ignores PrintWindowProp<br />
<b>2</b> - into the main tag instead of actual grid, like with NoVScroll / NoHScroll settings, ignores PrintCSS, PrintAllCSS, PrintHead and PrintWindowProp<br />
<b>3</b> - into the same page, instead of the page content, ignores PrintCSS, PrintAllCSS, PrintHead and PrintWindowProp<br />
<b>4</b> - <i>(new 13.2)</i> into the same page, but hides page content. Similar to 3, but more safe. Cannot be used if the page contains absolutely positioned content.<br />
<i>Since 12.1 default value changed to <b>3</b> in top window or to <b>0</b> in frame / iframe.</i><br />
To modify other page content for printing use <a href="#OnPrintFinish">OnPrintFinish</a> and restore the original in <a href="#OnPrintClose">OnPrintClose</a>.<br />

<!-- PrintPrint -->
<a name="CfgPrintPrint"></a>
<div class="XML">
   <u>new <b>7.1</b></u> <b>&lt;Cfg></b> <i>int</i>
   <h4>PrintPrint</h4> <s>[1]</s>
</div>
How the grid will be printed<br />
<b>0</b> - nothing will be shown<br />
<b>1</b> - print dialog will be shown<br />
<b>2</b> - alert for manual printing will be shown, remember to permit printing icons in the browser by <a href="#CfgPrintLocation">PrintLocation</a>.<br />
3, 4 - reserved<br />
<b>5</b> - print preview in IE will be shown if permitted the ActiveX, otherwise like 1<br />
<b>6</b> - print preview in IE will be shown if permitted the ActiveX, otherwise like 2<br />

<!-- PrintWindowOpen
<a name="CfgPrintWindowOpen"></a>
<div class="XML">
   <u>new <b>12.1</b></u> <b>&lt;Cfg></b> <i>int</i>
   <h4>PrintWindowOpen</h4> <s>[2]</s>
</div>
When the popup window will be opened, for <a href="#CfgPrintLocation">PrintLocation</a> 0 and 1.<br />
<b>0</b> - After the report is generated. Some browsers can block it when large report is generated.<br />
<b>1</b> - Before the report is generated. The window is focused, so it hides progress dialog in main window for large reports.<br />
<b>2</b> - In Firefox and Safari it is opened before the report is generated, in other browsers after the report is generated.<br />

<!-- PrintGrids -->
<a name="CfgPrintGrids"></a>
<div class="XML">
   <u>new <b>7.1</b></u> <b>&lt;Cfg></b> <i>string[ ]</i>
   <h4>PrintGrids</h4> <s></s>
</div>
To print more grids at once.<br />
A list of grid ids, comma separated, to print them all in one print job, at the same page.<br />
Set individual PrintPrefix / PrintPostfix to separate or structure the grids on page.<br />
The PrintLocation, PrintPrint, PrintCSS, PrintAllCSS, PrintHead and PrintWindowProp are read from the actual grid, the other printing properties from the individual grids.<br />
If set <tt>PrintLocation = 2</tt>, all grids are replaced inside their main tags, for other options are printed in the listed order.<br /><br />

If you use <a href="#CfgPrintPageHeight">PrintPageHeight</a> to split the grid vertically, you should permit it only in the main grid (with PrintGrids attribute) and the other grid(s) should have constant height.<br /> 
In this case this constant height set to the <a href="#CfgPrintPaddingHeightFirst">PrintPaddingHeightFirst</a> or <a href="#CfgPrintPaddingHeightLast">PrintPaddingHeightLast</a> attribute of the main grid to preserve space for the other grid(s).<br />

<!-- PrintCols -->
<a name="CfgPrintCols"></a>
<div class="XML">
   <u>new <b>6.0</b> <i>upd <b>6.7</b></i></u> <b>&lt;Cfg></b> <i>int</i>
   <h4>PrintCols</h4> <s>[2]</s>
</div>
If and which menu will be shown before printing.<br />
<b>0</b> - no menu<br />
<b>1</b> - menu with columns to select which columns will be printed. Only columns with <tt><a href="#CCanPrint">CanPrint</a>='1'</tt> and <tt>'2'</tt> are listed.<br />
<b>2</b> - <i>(new 6.7)</i> menu with column and also with printing options<br />
See <a href="GlobalSettings.htm#CfgMenu">Configuration menu</a> for basic settings or <a href="GlobalSettings.htm#MenuPrint">Print menu</a> for special settings.<br />

<!-- PrintRows -->
<a name="CfgPrintRows"></a>
<div class="XML">
   <u><i>upd <b>6.7</b></i></u> <b>&lt;Cfg></b> <i>int</i>
   <h4>PrintRows</h4> <s>[50] &nbsp; Saved to cookies, to not load it, set <tt><b>PrintLap</b>='1'</tt></s>
</div>
For how many rows will be displayed and updated progress bar. Displaying progress bar suppresses also message about slow script. <b>0</b> never shows progress bar.<br />
Too small value can slow down the printing.<br />                                                                           
It is used also as page length for <a href="#CfgPrintPageBreaks">PrintPageBreaks</a>.<br />
<i>Since 6.7</i> it can be changed via print menu and is saved to cookies.<br />

<!-- PrintCount -->
<a name="CfgPrintCount"></a>
<div class="XML">
   <u>new <b>7.1</b></u> <b>&lt;Cfg></b> <i>int</i>
   <h4>PrintCount</h4> <s></s>
</div>
Expected count of rows to print to show it in progress dialog.<br />
Usable especially when set <tt><a href="#CfgPrintLoad">PrintLoad</a> = 1</tt>.<br />
Can be set dynamically in <a href="#OnPrintInit">OnPrintInit</a> API event.<br />

<!-- PrintPrefix -->
<a name="CfgPrintPrefix"></a>
<div class="XML">
   <u></u> <b>&lt;Cfg></b> <i>string</i>
   <h4>PrintPrefix</h4> <s></s>
</div>
HTML code added in front of TreeGrid when printing, only before the first page.<br />

<!-- PrintPostfix -->
<a name="CfgPrintPostfix"></a>
<div class="XML">
   <u></u> <b>&lt;Cfg></b> <i>string</i>
   <h4>PrintPostfix</h4> <s></s>
</div>
HTML code added behind TreeGrid when printing, only after the last page.<br />

<!-- PrintHead -->
<a name="CfgPrintHead"></a>
<div class="XML">
   <u>new <b>7.1</b></u> <b>&lt;Cfg></b> <i>string</i>
   <h4>PrintHead</h4> <s></s>
</div>
HTML code added into the print page &lt;head> tag. Useful for adding meta tags to the page.<br />
Only for <tt><a href="#CfgPrintLocation">PrintLocation</a> = 0</tt> or <tt>1</tt><br />

<!-- PrintCSS -->
<a name="CfgPrintCSS"></a>
<div class="XML">
   <u></u> <b>&lt;Cfg></b> <i>string</i>
   <h4>PrintCSS</h4> <s></s>
</div>
Url of CSS style sheet for printing used instead of default CSS style sheet<br /> 
Only for <tt><a href="#CfgPrintLocation">PrintLocation</a> = 0</tt> or <tt>1</tt><br />

<!-- PrintAllCSS -->
<a name="CfgPrintAllCSS"></a>
<div class="XML">
   <u>new <b>14.0</b></u> <b>&lt;Cfg></b> <i>bool</i>
   <h4>PrintAllCSS</h4> <s></s>
</div>
If set, adds all &lt;style> tags from original page to the print page.<br />
If not set, adds only all style links and TreeGrid CSS styles.<br />
Ignored if set <a href="#CfgPrintCSS">PrintCSS</a> or set <a href="#CfgPrintLocation">PrintLocation</a> = <b>2</b>.<br />


<!-- PrintAddCSS -->
<a name="CfgPrintAddCSS"></a>
<div class="XML">
   <u>new <b>10.0</b></u> <b>&lt;Cfg></b> <i>string</i>
   <h4>PrintAddCSS</h4> <s></s>
</div>
Url of CSS style sheet added for printing. Used with <a href="#CfgPrintCSS">PrintCSS</a> or with default CSS styles. Can be used also to add Gantt style if required.<br />
Only for <tt><a href="#CfgPrintLocation">PrintLocation</a> = 0</tt> or <tt>1</tt><br />

<!-- PrintWindowProp -->
<a name="CfgPrintWindowProp"></a>
<div class="XML">
   <u></u> <b>&lt;Cfg></b> <i>string</i>
   <h4>PrintWindowProp</h4> <s></s>
</div>
Properties of printing window (the third attribute to window.open)<br />
Only for <tt><a href="#CfgPrintLocation">PrintLocation</a> = 0</tt><br />

<!--------------------------------------------------------- Choosing items to print --------------------------------------------------------->
<a name="Items"></a>
<h2>Choosing items to print</h2>
<i>Shared for printing and printing to PDF.</i><br />

<!-- CanPrint -->
<a name="ICanPrint"></a>
<div class="XML">
   <u>new <b>6.0</b> <i>upd <b>9.0</b></i></u> <b>&lt;I></b> <i>int</i>
   <h4>CanPrint</h4> <s>[0/1/2]</s>
</div>
If the row will be printed.<br />
<b>0</b> - never, <b>1</b> - once if visible, <b>2</b> - on every page (only for fixed and space rows) if visible,<br /> 
<b>3</b> - <i>(new 7.1)</i> once always, <b>4</b> - <i>(new 7.1)</i> on every page (only for fixed and space rows) always<br /> 
<b>5</b> - <i>(new 9.0)</i> on every col page (only for space rows) if visible, <b>6</b> - <i>(new 9.0)</i> on every page and col page (only for space rows) if visible,<br />
<b>7</b> - <i>(new 9.0)</i> on every col page (only for space rows) always, <b>8</b> - <i>(new 9.0)</i> on every page and col page (only for space rows) always,<br /><br />

By default <b>Toolbar</b> and <b>Panel</b> have <b>0</b>, <b>Header</b> has <b>2</b> and all other rows have <b>1</b>.<br />

<!-- CanPrint -->
<a name="CCanPrint"></a>
<div class="XML">
   <u>new <b>6.0</b> <i>upd <b>9.0</b></i></u> <b>&lt;C></b> <i>int</i>
   <h4>CanPrint</h4> <s>[0/1]</s>
</div>
If the column will be printed.<br />
<b>0</b> - never, <b>1</b> - once if visible, <b>2</b> - <i>(new 9.0)</i> on every page if visible,<br /> 
<b>3</b> - <i>(new 9.0)</i> once always, <b>4</b> - <i>(new 9.0)</i> on every page always<br /> 
By default <b>Panel</b> has <b>0</b> and other columns <b>1</b>.<br />
More changes for printing can be done by &lt;<a href="Media.htm#Media">Media</a>>&lt;M <a href="Media.htm#MMedia">Media</a>='<b>Print</b>' ... />&lt;Media>.<br />

<!-- CanPrint -->
<a name="CellCanPrint"></a>
<div class="XML">
   <u>new <b>7.1</b></u> <b>&lt;cell></b> <i>int</i>
   <h4>CanPrint</h4> <s>[1]</s>
</div>
If the cell will be printed. Useful especially for Space cells.<br />
<b>0</b> - never, <b>1</b> - if visible, <b>2</b> - always.<br />

<!-- MenuCheck -->
<a name="CMenuCheck"></a>
<div class="XML">
   <u>new <b>14.1</b></u> <b>&lt;C> &lt;I></b> <i>bool</i>
   <h4>MenuCheck</h4> <s></s>
</div>
If the column or row is checked in the print and export menu. If not set, the item is checked according to its Visible and CanPrint/CanExport setting.<br />

<!-- PrintHPage -->
<a name="PrintHPage"></a>
<div class="XML">
   <u>new <b>9.0</b></u> <b>&lt;cell></b> <i>int</i>
   <h4>PrintHPage</h4> <s>[0]</s>
</div>
<i>Only for Space rows with <a href="#ICanPrint">CanPrint</a>>=5.</i><br />
To which horizontal page will be the cell printed. <b>0</b> means every page, <b>1</b> the first page, <b>2</b> the second page, ...<br />
If there are fewer pages than the value, the cell will be printed at the last page.<br />

<!-- PrintHeight -->
<a name="IPrintHeight"></a>
<div class="XML">
   <u>new <b>9.0</b></u> <b>&lt;I></b> <i>int</i>
   <h4>PrintHeight</h4> <s></s>
</div>
Minimal height of the row when printed. In pixels. If not set, actual row height is used.<br />
Useful especially variable height rows or rows with nested grid.<br />

<!-- PrintVarHeight -->
<a name="CfgPrintVarHeight"></a>
<div class="XML">
   <u>new <b>9.0</b> <i>upd <b>14.0</b></i></u> <b>&lt;Cfg></b> <i>int</i>
   <h4>PrintVarHeight</h4> <s>[1]</s>
</div>
<b>0</b> - All columns are printed as they are, without external height calculation. It can lead to higher pages than expected, if rows contain multiline cells.<br />
<b>1</b> - If there is printed at least one column with <a href="#CVarHeight">VarHeight</a>>=1, it recalculates height of all rows for printing. It can slow down printing and print dialog recalculating, but preserves page height.<br />
<b>2</b> - Like <b>1</b> and also ignores row <a href="RowHeight.htm#IMaxHeight">MaxHeight</a> attribute to print the whole content of all multiline cells.<br />
<b>3</b> - <i>(Since 14.0)</i> Like <b>2</b> and never calculates row height smaller than row default height.<br />

<!-- VarHeight -->
<a name="CVarHeight"></a>
<div class="XML">
   <u>new <b>7.0</b></u> <b>&lt;C></b> <i>int</i>
   <h4>VarHeight</h4> <s>[0]</s>
</div>
Set it to <b>1</b> (or <b>2</b>) to columns containing multiline cells to let their height to calculate dynamically to preserve page height. Only with <a href="#CfgPrintVarHeight">PrintVarHeight</a>>=1.<br />
The VarHeight attribute also controls shrinking cell height when column width is increased, see <a href="ColWidth.htm#CVarHeight">VarHeight</a>.<br />

<!-- VarHeightType -->
<a name="CVarHeightType"></a>
<div class="XML">
   <u>new <b>13.3</b></u> <b>&lt;C></b> <i>int</i>
   <h4>VarHeightType</h4> <s>[0]</s>
</div>
Which cells will be ignored in testing <a href="#CVarHeight">VarHeight</a> columns for <a href="#CfgPrintVarHeight">PrintVarHeight</a>. To speed up the calculation. Bit array.<br />
1. bit &amp;<b>1</b> - Empty cells will be ignored.<br />
2. bit &amp;<b>2</b> - Number values will be ignored.<br />
3. bit &amp;<b>4</b> - Texts with only letters and numbers without spaces will be ignored.<br />

<!-- VarHeight -->
<a name="IVarHeight"></a>
<div class="XML">
   <u>new <b>14.0</b></u> <b>&lt;I></b> <i>bool</i>
   <h4>VarHeight</h4> <s>[1]</s>
</div>
If the row calculates its height for printing using <a href="#CfgPrintVarHeight">PrintVarHeight</a>.

<!-- PrintWidth -->
<a name="CPrintWidth"></a>
<div class="XML">
   <u>new <b>9.0</b></u> <b>&lt;C></b> <i>int</i>
   <h4>PrintWidth</h4> <s></s>
</div>
Width of the column when printed. In pixels. If not set, actual column width is used.<br />
Useful especially for relative width columns.<br />

<!-- Block -->
<a name="CBlock"></a>
<div class="XML">
   <u>renamed <b>9.2</b></u> <b>&lt;C></b> <i>int</i>
   <h4>Block</h4> <s>[0]</s>
</div>
Controls splitting columns among horizontal pages, it is useful especially if there are some cells spanned to or from other columns.<br />
If set to > 0, it is the group the column belongs to. Create groups that contain the spanned cells. The groups must be continuous.<br />
The group of columns is divided to more pages only if it is wider than the page width.<br />
<i>If spanned cell is split between printed pages, its content is printed to every page!</i><br />
This attribute controls also dragging columns, see <a href="ColPosition.htm#CBlock">Block</a>.<br />
<i>Since 9.2 it was renamed from <b>Group</b>.</i>

<!-- PrintExpanded -->
<a name="CfgPrintExpanded"></a>
<div class="XML">
   <u>renamed <b>6.0</b> <i>upd <b>6.7</b></i></u> <b>&lt;Cfg></b> <i>bool</i>
   <h4>PrintExpanded</h4> <s>[0] &nbsp; Saved to cookies, to not load it, set <tt><b>PrintLap</b>='1'</tt></s>
</div>
If prints all rows expanded.<br />
If set to 0, only actually expanded rows prints their children.<br />
<i>Since 6.7</i> it can be changed via print menu and is saved to cookies.<br />

<!-- PrintFiltered -->
<a name="CfgPrintFiltered"></a>
<div class="XML">
   <u>new <b>6.7</b></u> <b>&lt;Cfg></b> <i>bool</i>
   <h4>PrintFiltered</h4> <s>[0] &nbsp; Saved to cookies, to not load it, set <tt><b>PrintLap</b>='1'</tt></s>
</div>
If prints all rows, including the hidden.<br />
It can be changed via print menu and is saved to cookies.<br />

<!-- PrintSelected -->
<a name="CfgPrintSelected"></a>
<div class="XML">
   <u>new <b>9.0</b></u> <b>&lt;Cfg></b> <i>bool</i>
   <h4>PrintSelected</h4> <s>[0] &nbsp; Saved to cookies, to not load it, set <tt><b>PrintLap</b>='1'</tt></s>
</div>
If prints only selected rows, columns or cells.<br />
Even if set, it always prints all rows and columns that cannot be selected.<br />

<!-- PrintOnlyData -->
<a name="CfgPrintOnlyData"></a>
<div class="XML">
   <u>new <b>15.0</b></u> <b>&lt;Cfg></b> <i>bool</i>
   <h4>PrintOnlyData</h4> <s>[0] &nbsp; Saved to cookies, to not load it, set <tt><b>PrintLap</b>='1'</tt></s>
</div>
If set, does not print empty styled rows and empty styled columns if set AutoPages / AutoColPages.<br />
Useful for xlsx that contain incorrectly styled rows or columns.<br />


<!-- PrintLoad -->
<a name="CfgPrintLoad"></a>
<div class="XML">
   <u>new <b>7.1</b> <i>upd <b>14.0</b></i></u> <b>&lt;Cfg></b> <i>int</i>
   <h4>PrintLoad</h4> <s>[0]</s>
</div>
Set to <b>1</b> in server paging or child paging to download all rows to be printed.<br />
<i>Since 13.1</i> if set to <b>2</b> it downloads all rows also if set <a href="#CfgPrintSelected">PrintSelected</a> - useful if row selection is saved on server.<br />
<i>Since 14.0</i> if set to <b>3</b> it downloads all rows on start synchronously also for asynchronous pages.<br />
Be careful permitting this option, it will download all pages and optionally child pages, when set <a href="#CfgPrintExpanded">PrintExpanded</a>.<br />
The count of rows is not known, so the progress dialog does not show correct values except set <a href="#CfgPrintCount">PrintCount</a>.<br />

<!-- PrintCheckboxes -->
<a name="CfgPrintCheckboxes"></a>
<div class="XML">
   <u>new <b>6.7</b></u> <b>&lt;Cfg></b> <i>bool</i>
   <h4>PrintCheckboxes</h4> <s>[0]</s>
</div>
For <b>1</b> it prints all checkboxes and radio buttons as standard HTML checkbox and radio button inputs instead of style images.<br />
Useful when expected printing without background images.<br />

<!-- PrintIcons -->
<a name="CfgPrintIcons"></a>
<div class="XML">
   <u>new <b>7.1</b> <i>upd <b>8.1</b></i></u> <b>&lt;Cfg></b> <i>int</i>
   <h4>PrintIcons</h4> <s>[1]</s>
</div>
For <b>0</b> it does not print cell side icons Calendar, Enum and Defaults. It still prints Sort, Filter, Expand and custom icons.<br />
<i>(Since 8.1)</i> For -<b>1</b> it does not print Calendar, Enum and Defaults and custom icons. It still prints Sort, Filter, Expand.<br />

<!-- NoPrintTreeLines -->
<a name="CfgNoPrintTreeLines"></a>
<div class="XML">
   <u>new <b>9.0</b> <i>upd <b>13.3</b></i></u> <b>&lt;Cfg></b> <i>int</i>
   <h4>NoPrintTreeLines</h4> <s>[ ]</s>
</div>
If set to <b>1</b>, it does not show connecting lines in tree when printing, shows only expand / collapse buttons.<br />
If set to <b>2</b>, it is set to 1 in Chrome/Safari and to 0 in other browsers, as the WebKit has problems with printing tree lines.<br />
If empty, uses value of <a href="Tree.htm#CfgNoTreeLines">NoTreeLines</a>.<br />

<!-- PrintVisible -->
<a name="CfgPrintVisible"></a>
<div class="XML">
   <u>new <b>8.0</b></u> <b>&lt;Cfg></b> <i>bool</i>
   <h4>PrintVisible</h4> <s>[0] &nbsp; Saved to cookies, to not load it, set <tt><b>PrintLap</b>='1'</tt></s>
</div>
<i>Only for Gantt chart.</i> If set, it prints only visible part of the actually scrolled / zoomed Gantt chart (horizontally).<br />
It can be changed via print menu and is saved to cookies.<br />

<!-- PrintGanttBackground -->
<a name="CfgPrintGanttBackground"></a>
<div class="XML">
   <u>new <b>8.0</b> chg <b>13.2</b></u> <b>&lt;Cfg></b> <i>int</i>
   <h4>PrintGanttBackground</h4> <s>[1]</s>
</div>
If prints global Gantt background, shown for attributes GanttBackground, GanttExclude, GanttBase, GanttFinish.<br />
<i>Since 13.0</i> if set to <b>2</b> or to <b>4</b>, it prints background in &lt;svg> to speed up the rendering.<i>It can cause problems for some PDF exporters.</i><br />
<i>Since 13.2</i> if set to <b>1</b> or <b>2</b> it prints the global background once on the grid background, 
if set to <b>3</b> or <b>4</b> it prints the global background in every row background - more compatible but remarkably slower.<br />
<i>Since 13.2</i> the default value was set back to <b>1</b> because 2 has problems with PDF exporters.<br />

<!-- PrintGanttRowHeight -->
<a name="CfgPrintGanttRowHeight"></a>
<div class="XML">
   <u>new <b>13.2</b></u> <b>&lt;Cfg></b> <i>int</i>
   <h4>PrintGanttRowHeight</h4> <s>[50]</s>
</div>
Default height in pixels of all Gantt objects in grid when printing.<br />
Default height of Gantt objects is 5000px when rendering, but in PDF it slows down the PDF, so it is reduced to row height.<br />
Increase this value to maximal expected row height if exporting to PDF a Gantt with variable row heights (e.g. with type Lines).<br />

<!----------------------------------------------------------------------- Page size ------------------------------------------------------------------->
<a name="Page"></a>
<h2>Page size</h2>
<i>Shared for printing and printing to PDF.</i><br /><br />

It is possible to split the printed grid horizontally and vertically to more pages.<br />
The maximal size of page is set by PrintPageWidth - PrintPaddingWidth x PrintPageHeight - PrintPaddingHeight. If the grid is bigger, it is split to more pages.<br />
Note, nested grid is never split to pages.<br /><br />

<strong>These settings do <u>not</u> affect the paper size, orientation and margins selected by a user in his printing dialog! JavaScript cannot control or even read these settings!</strong><br />
So a user must always select the same values twice, in TreeGrid print dialog and browser/system print dialog.<br /><br />

<i>If there are printed <b>empty pages</b> between normal pages, it often helps increasing <a href="#CfgPrintPaddingHeight">PrintPaddingHeight</a>.</i><br />

<!-- PrintPageWidth -->
<a name="CfgPrintPageWidth"></a>
<div class="XML">
   <u>new <b>9.0</b></u> <b>&lt;Cfg></b> <i>int</i>
   <h4>PrintPageWidth</h4> <s>[643] &nbsp; Saved to cookies, to not load it, set <tt><b>PrintLap</b>='1'</tt></s>
</div>
Width of page for printing, in pixels.<br />
If the printed chart is wider than this value, it is split to more pages horizontally.<br />
The grid is always split between columns, only Gantt type column can be divided to more parts if set <tt><a href="#CfgPrintGanttSplit">PrintGanttSplit</a> = 1</tt>.<br />
Every page contains all columns with <tt><a href="#CCanPrint">CanPrint</a> = <b>2</b></tt> and next set of columns with <tt><a href="#CCanPrint">CanPrint</a> = <b>1</b></tt>.<br />
  <div class="L1">If the place for the next columns is less than <b>100</b> pixels, the grid is <u>not</u> split horizontally.</div> 
If set to <b>0</b>, the printed chart is not split to pages horizontally. Also items for page width are hidden from print columns menu.<br />
To only hide the Page width option from print columns menu, add &lt;Lang>&lt;Text PrintWidth=""/>&lt;/Lang>.<br />
Value 643 corresponds with page A4 portrait, 96 DPI and 40mm margin.<br />
<i>Remember, this attribute cannot control the final printing page chosen by user in printing dialog!</i><br />

<!-- PrintPageHeight -->
<a name="CfgPrintPageHeight"></a>
<div class="XML">
   <u>new <b>9.0</b></u> <b>&lt;Cfg></b> <i>int</i>
   <h4>PrintPageHeight</h4> <s>[971] &nbsp; Saved to cookies, to not load it, set <tt><b>PrintLap</b>='1'</tt></s>
</div>
Height of page for printing, in pixels.<br />
If the printed chart is higher than this value, it is split to more pages vertically.<br />
The grid is always split between rows.<br />
Every page contains all rows with <tt><a href="#ICanPrint">CanPrint</a> = <b>2</b></tt> and next set of rows with <tt><a href="#ICanPrint">CanPrint</a> = <b>1</b></tt>.<br />
If set to <b>0</b>, the printed chart is not split to pages horizontally, except set <a href="#CfgPrintPageBreaks">PrintPageBreaks</a>. Also items for page height are hidden from print columns menu.<br />
To only hide the Page height option from print columns menu, add &lt;Lang>&lt;Text PrintHeight=""/>&lt;/Lang>.<br />
Value 971 corresponds with page A4 portrait, 96 DPI and 40mm margin.<br />

<!-- PrintPageSize -->
<a name="CfgPrintPageSize"></a>
<div class="XML">
   <u>new <b>9.0</b></u> <b>&lt;Cfg></b> <i>int</i>
   <h4>PrintPageSize</h4> <s>[8] &nbsp; Saved to cookies, to not load it, set <tt><b>PrintLap</b>='1'</tt></s>
</div>
<i>Affects only TreeGrid print dialog (shown by <tt><a href="#CfgPrintCols">PrintCols</a>=2</tt>).</i><br />
Selected item in Page sizes list, defined by &lt;Lang>&lt;Text PrintPageSizes/>&lt;/Lang>, by default in Text.xml<br />
The PrintPageSizes attribute contains first character separated list as <tt>"|name1|width1|height1|name2|width2|height2|name3|..."</tt><br />
  <div class="L1">The name is page size name shown in the list, width and height is the page size in millimeters. <b>pixels = mm / 25.4 x DPI</b></div>
When changed by a user in the print dialog, it recalculates <a href="#CfgPrintPageWidth">PrintPageWidth</a> and <a href="#CfgPrintPageHeight">PrintPageHeight</a> attributes accordingly.<br />
  <div class="L1">
  PrintPageWidth = (PrintPageSize[width] - PrintMarginWidth) / 25.4 * PrintDPI<br />
	PrintPageHeight = (PrintPageSize[height] - PrintMarginHeight) / 25.4 * PrintDPI<br />
  </div>
If set PrintPageOrientation to <b>1</b> (landscape) it just swaps the width and height in PrintPageSize.<br />

<!-- PrintPageOrientation -->
<a name="CfgPrintPageOrientation"></a>
<div class="XML">
   <u>new <b>9.0</b></u> <b>&lt;Cfg></b> <i>int</i>
   <h4>PrintPageOrientation</h4> <s>[0] &nbsp; Saved to cookies, to not load it, set <tt><b>PrintLap</b>='1'</tt></s>
</div>
<i>Affects only TreeGrid print dialog (shown by <tt><a href="#CfgPrintCols">PrintCols</a>=2</tt>).</i><br />
The print page orientation - portrait or landscape.<br />
If set to <b>1</b> (landscape), it just swaps width and height in <a href="#CfgPrintPageSize">PrintPageSize</a>.<br />

<!-- PrintDPI -->
<a name="CfgPrintDPI"></a>
<div class="XML">
   <u>new <b>9.0</b></u> <b>&lt;Cfg></b> <i>int</i>
   <h4>PrintDPI</h4> <s>[96] &nbsp; Saved to cookies, to not load it, set <tt><b>PrintLap</b>='1'</tt></s>
</div>
<i>Affects only TreeGrid print dialog (shown by <tt><a href="#CfgPrintCols">PrintCols</a>=2</tt>).</i><br />
DPI (PPI) ratio - pixels per inch.<br />
Default value for most browsers is 96. Changing this value zooms the printed page, higher value = bigger page.<br />
When changed by a user in the print dialog, it recalculates <a href="#CfgPrintPageWidth">PrintPageWidth</a> and <a href="#CfgPrintPageHeight">PrintPageHeight</a> attributes accordingly.<br />

<!-- PrintDefaultDPI -->
<a name="CfgPrintDefaultDPI"></a>
<div class="XML">
   <u>new <b>9.0</b></u> <b>&lt;Cfg></b> <i>int</i>
   <h4>PrintDefaultDPI</h4> <s>[96]</s>
</div>
<i>Affects only TreeGrid PDF print dialog (shown by <tt><a href="#CfgPrintCols">PrintCols</a>=2</tt> in PDF export).</i><br />
Default PrintDPI value, used when PDFFitPage is changed to 0.<br />

<!-- PrintMinDPI -->
<a name="CfgPrintMinDPI"></a>
<div class="XML">
   <u>new <b>9.0</b></u> <b>&lt;Cfg></b> <i>int</i>
   <h4>PrintMinDPI</h4> <s>[96]</s>
</div>
<i>Affects only TreeGrid PDF print dialog (shown by <tt><a href="#CfgPrintCols">PrintCols</a>=2</tt> in PDF export).</i><br />
Minimal PrintDPI value, used when PDFFitPage is changed to >0. If the value is less than 96, it permits stretching the grid width to fit the page. It should not be higher than 96.<br />

<!-- PrintMarginWidth -->
<a name="CfgPrintMarginWidth"></a>
<div class="XML">
   <u>new <b>9.0</b></u> <b>&lt;Cfg></b> <i>int</i>
   <h4>PrintMarginWidth</h4> <s>[40]</s>
</div>
<i>Affects only TreeGrid print dialog (shown by <tt><a href="#CfgPrintCols">PrintCols</a>=2</tt>).</i><br />
Left + right margin of the page, in millimeters. (pixels = mm / 25.4 x DPI)<br />
When changed by a user in the print dialog, it recalculates <a href="#CfgPrintPageWidth">PrintPageWidth</a> attribute accordingly. It is subtracted from page width.<br />

<!-- PrintMarginHeight -->
<a name="CfgPrintMarginHeight"></a>
<div class="XML">
   <u>new <b>9.0</b></u> <b>&lt;Cfg></b> <i>int</i>
   <h4>PrintMarginHeight</h4> <s>[40]</s>
</div>
<i>Affects only TreeGrid print dialog (shown by <tt><a href="#CfgPrintCols">PrintCols</a>=2</tt>).</i><br />
Top + bottom margin of the page, in millimeters. (pixels = mm / 25.4 x DPI)<br />
When changed by a user in the print dialog, it recalculates <a href="#CfgPrintPageHeight">PrintPageHeight</a> attribute accordingly. It is subtracted from page height.<br />

<!-- PrintMarginDiv -->
<a name="CfgPrintMarginDiv"></a>
<div class="XML">
   <u>new <b>12.0</b></u> <b>&lt;Cfg></b> <i>float</i>
   <h4>PrintMarginDiv</h4> <s>[1]</s>
</div>
Shows the PrintMarginHeight and PrintMarginWidth in Print columns menu divided by this value. 
Set PrintMarginDiv='25.4' to display the margin values in inches.<br />

<!-- PrintPaddingWidth -->
<a name="CfgPrintPaddingWidth"></a>
<div class="XML">
   <u>new <b>9.0</b></u> <b>&lt;Cfg></b> <i>int</i>
   <h4>PrintPaddingWidth</h4> <s>[0]</s>
</div>
Reserved width on page (in pixels), for other content on page, e.g. for <a href="#CfgPrintPagePrefix">PrintPagePrefix</a> / <a href="#CfgPrintPagePostfix">PrintPagePostfix</a> or HTML body margin / border / padding<br />
It is subtracted from <a href="#CfgPrintPageWidth">PrintPageWidth</a> when printing, not in the print menu.<br />

<!-- PrintPaddingHeight -->
<a name="CfgPrintPaddingHeight"></a>
<div class="XML">
   <u>new <b>9.0</b></u> <b>&lt;Cfg></b> <i>int</i>
   <h4>PrintPaddingHeight</h4> <s>[0]</s>
</div>
Reserved height on page (in pixels), for other content on page, e.g. for <a href="#CfgPrintPagePrefix">PrintPagePrefix</a> / <a href="#CfgPrintPagePostfix">PrintPagePostfix</a> or HTML body margin / border / padding<br />
It is subtracted from <a href="#CfgPrintPageHeight">PrintPageHeight</a> when printing, not in the print menu.<br />

<!-- PrintPaddingHeightFirst -->
<a name="CfgPrintPaddingHeightFirst"></a>
<div class="XML">
   <u>new <b>9.0</b></u> <b>&lt;Cfg></b> <i>int</i>
   <h4>PrintPaddingHeightFirst</h4> <s>[0]</s>
</div>
Reserved height on the first page, for other content on the first page, e.g. for <a href="#CfgPrintPrefix">PrintPrefix</a><br />
It is subtracted from <a href="#CfgPrintPageHeight">PrintPageHeight</a> when printing, not in the print menu.<br />
For grid split horizontally, it is added to every first page (to preserve the horizontal page synchronization).<br />
It is used along with <a href="#CfgPrintPaddingHeight">PrintPaddingHeight</a>, <b>not</b> instead of it.<br />

<!-- PrintPaddingHeightLast -->
<a name="CfgPrintPaddingHeightLast"></a>
<div class="XML">
   <u>new <b>9.0</b></u> <b>&lt;Cfg></b> <i>int</i>
   <h4>PrintPaddingHeightLast</h4> <s>[0]</s>
</div>
Reserved height on the last page, for other content on last first page, e.g. for <a href="#CfgPrintPostfix">PrintPostfix</a><br />
It is subtracted from <a href="#CfgPrintPageHeight">PrintPageHeight</a> when printing, not in the print menu.<br />
For grid split horizontally, it is added to every last page (to preserve the horizontal page synchronization).<br />
It is used along with <a href="#CfgPrintPaddingHeight">PrintPaddingHeight</a>, <b>not</b> instead of it.<br />

<!-- PrintConstWidth -->
<a name="CfgPrintConstWidth"></a>
<div class="XML">
   <u>new <b>9.0</b> <i>upd <b>15.0</b></i></u> <b>&lt;Cfg></b> <i>int</i>
   <h4>PrintConstWidth</h4> <s>[0]</s>
</div>
If set, all pages will get the same, maximal, width.<br />
If set to <b>1</b>: by adding right empty column. Useful to preserve width of space rows.<br />
If set to <b>2</b> (<i>new 14.0</i>): by resizing the last column in the printed section. Useful to preserve width of spanned cells.<br />
If set to <b>3</b> (<i>new 15.0</i>): by resizing all columns with by the same ratio. Useful to preserve width of spanned cells.<br />
If set to <b>4</b> (<i>new 15.0</i>): by resizing the last column in the printed section if contains spanned cells or by resizing all columns with by the same ratio. <i>It can be slower.</i><br />

<!-- PrintConstWidth -->
<a name="CfgPrintConstWidth"></a>
<div class="XML">
   <u>new <b>14.1</b></u> <b>&lt;C></b> <i>bool</i>
   <h4>PrintConstWidth</h4> <s>[0]</s>
</div>
If set PrintConstWidth to column, resizes the column to get the printed page maximal width.

<!-- PrintGanttSplit -->
<a name="CfgPrintGanttSplit"></a>
<div class="XML">
   <u>new <b>9.0</b></u> <b>&lt;Cfg></b> <i>bool</i>
   <h4>PrintGanttSplit</h4> <s>[1]</s>
</div>
If Gantt chart column can be split if it is wider than selected page by <a href="#CfgPrintPageWidth">PrintPageWidth</a>.<br />
The individual Gantt pages dates will be rounded to <a href="GanttZoom.htm#CGanttPrintRound">GanttPrintRound</a> or if not set, to <a href="GanttZoom.htm#CGanttUnits">GanttUnits</a>.<br />

<!-- PrintGanttSplitMin -->
<a name="CfgPrintGanttSplitMin"></a>
<div class="XML">
   <u>new <b>9.0</b></u> <b>&lt;Cfg></b> <i>int</i>
   <h4>PrintGanttSplitMin</h4> <s>[100]</s>
</div>
Minimal size in pixels of printed part of Gantt when split by <a href="#CfgPrintGanttSplit">PrintGanttSplit</a>.<br />
It affects the first and last page part of the printed Gantt.<br />

<!-- PrintSplitRowSpan -->
<a name="CfgPrintSplitRowSpan"></a>
<div class="XML">
   <u>new <b>14.0</b></u> <b>&lt;Cfg></b> <i>bool</i>
   <h4>PrintSplitRowSpan</h4> <s>[1]</s>
</div>
If the horizontally spanned cells can be split to two pages.<br />

<!-- PrintPageBreaks -->
<a name="CfgPrintPageBreaks"></a>
<div class="XML">
   <u>renamed <b>6.0</b> <i>upd <b>6.7</b></i></u> <b>&lt;Cfg></b> <i>bool</i>
   <h4>PrintPageBreaks</h4> <s>[0] &nbsp; Saved to cookies, to not load it, set <tt><b>PrintLap</b>='1'</tt></s>
</div>
Prints page break after every <a href="#CfgPrintRows">PrintRows</a> variable rows.<br />
For every page it prints new table with all fixed and space rows that have <tt><a href="#ICanPrint">CanPrint</a>='<b>2</b>'</tt><br />
<i>Since 6.7</i> it can be changed via print menu and is saved to cookies.<br />
It does <u>not</u> affect <a href="#CfgPrintPageHeight">PrintPageHeight</a>, both these attributes can be used separately or together.<br />

<!-- NoPageBreak -->
<a name="INoPageBreak"></a>
<div class="XML">
   <u>new <b>9.0</b></u> <b>&lt;I></b> <i>bool</i>
   <h4>NoPageBreak</h4> <s>[0]</s>
</div>
If set to <b>1</b>, grid does not break page before the row, except it would lead to higher page.<br />

<!-- PrintPageRoot -->
<a name="CfgPrintPageRoot"></a>
<div class="XML">
   <u>new <b>7.1</b> <i>upd <b>9.0</b></i></u> <b>&lt;Cfg></b> <i>bool</i>
   <h4>PrintPageRoot</h4> <s>[0] &nbsp; Saved to cookies, to not load it, set <tt><b>PrintLap</b>='1'</tt></s>
</div>
For <b>1</b> it prints page break only between root rows (preserves printing children with their parent).<br />
It breaks children only the parent children are higher than page height or PrintRows, in this case <i>(since 9.0)</i> it tries to preserve at least sub children on next tree levels, if any.<br />
<i>Since 9.0</i> it can be changed via print menu and is saved to cookies and also never creates higher page than PrintRow.<br />

<!-- PrintPageRootMin -->
<a name="CfgPrintPageRootMin"></a>
<div class="XML">
   <u>new <b>9.1</b></u> <b>&lt;Cfg></b> <i>int</i>
   <h4>PrintPageRootMin</h4> <s>[10]</s>
</div>
Minimal count of rows on page when applied PrintPageRoot, to avoid pages with only few rows.<br />

<!-- PrintPagePrefix -->
<a name="CfgPrintPagePrefix"></a>
<div class="XML">
   <u>new <b>9.0</b> <i>upd <b>14.0</b></i></u> <b>&lt;Cfg></b> <i>string</i>
   <h4>PrintPagePrefix</h4> <s></s>
</div>
HTML code added in front of every TreeGrid page when printing.<br />
If it contains these strings, they are replaced by: <b>%1</b> horizontal page index, 
<b>%2</b> vertical page index, <b>%3</b> page index, <b>%4</b> horizontal page count, 
<b>%5</b> vertical page count, <b>%6</b> page count, <b>%7</b> page width in pixels, 
<b>%8</b> page height in pixels, <b>%9</b> <i>(since 14.0)</i> full css style/size/scale class.
<br />
The page counts (%3,%4,%5) should not be used with <a href="#CfgPrintLoad">PrintLoad</a>.<br />

<!-- PrintPagePostfix -->
<a name="CfgPrintPagePostfix"></a>
<div class="XML">
   <u>new <b>9.0</b> <i>upd <b>14.0</b></i></u> <b>&lt;Cfg></b> <i>string</i>
   <h4>PrintPagePostfix</h4> <s></s>
</div>
HTML code added behind every TreeGrid page when printing.<br />
If it contains these strings, they are replaced by: <b>%1</b> horizontal page index, 
<b>%2</b> vertical page index, <b>%3</b> page index, <b>%4</b> horizontal page count, 
<b>%5</b> vertical page count, <b>%6</b> page count, <b>%7</b> page width in pixels, 
<b>%8</b> page height in pixels, <b>%9</b> <i>(since 14.0)</i> full css style/size/scale class.<br />
<b>%0</b> <i>(new 14.0)</i> the rest of empty height on printed page in pixels, useful to use in margin-top to place the postfix to bottom of every page.<br />
The page counts (%3,%4,%5) should not be used with <a href="#CfgPrintLoad">PrintLoad</a>.<br />

<!-- PrintZoomFit -->
<a name="CfgPrintZoomFit"></a>
<div class="XML">
   <u>new <b>12.0</b> chg <b>12.1</b></u> <b>&lt;Cfg></b> <i>int</i>
   <h4>PrintZoomFit</h4> <s>[1]</s>
</div>
If set to <b>1</b>, it shrinks the printed grid pages to be always printed whole regardless on page size, orientation and margin chosen in system / browser print dialog.<br />
If set to <b>2</b>, it works as <b>1</b> and also resizes too small grid pages to fill at least one direction of the printed page.<br />
<i>Using this attributes cancels the requirement to choose the same pages size, orientation and margins in TreeGrid print dialog and system / browser print dialog.</i><br />
If the attribute is set, it also uses <a href="#CfgPDFFitPage">PDFFitPage</a> and shows this option in print menu.<br />
<i>This attribute is ignored if set <tt><a href="#CfgPrintLocation">PrintLocation</a>=<b>2</b></tt>. This attribute is ignored in IE8 and older.</i><br />
<i>Since 12.1</i> default value changed from 0 to 1.<br />
It is fully supported in IE9+ and Chrome. It has small problems in Safari. In Firefox it requires setting the same page margins in TreeGrid print dialog and system print dialog. Edge cannot be used for printing because it does not print background images.<br />

<!-- PDFFitPage -->
<a name="CfgPDFFitPage"></a>
<div class="XML">
   <u>new <b>6.7</b> chg <b>12.0</b></u> <b>&lt;Cfg></b> <i>int</i>
   <h4>PDFFitPage</h4> <s>[0] &nbsp; Saved to cookies, to not load it, set <tt><b>PrintLap</b>='1'</tt></s>
</div>
Shrinks or resizes the printed grid to be printed in one page in given or both directions.<br />
<b>0</b> = Real size, <b>1</b> = Width, <b>2</b> = Height, <b>3</b> = Single page.<br />
<i>Since 12.0 this attribute is used not only for PDF export, but also for normal printing to printer if set <a href="#CfgPrintZoomFit">PrintZoomFit</a>.</i><br />

<!-- PrintFromPage -->
<a name="CfgPrintFromPage"></a>
<div class="XML">
   <u>new <b>14.0</b></u> <b>&lt;Cfg></b> <i>int</i>
   <h4>PrintFromPage</h4> <s></s>
</div>
If set, starts printing from this page, 1 means the first page.<br />
If the start page is outside actual pages, the <a href="#OnPrintEmpty">OnPrintEmpty</a> is called.

<!-- PrintToPage -->
<a name="CfgPrintToPage"></a>
<div class="XML">
   <u>new <b>14.0</b></u> <b>&lt;Cfg></b> <i>int</i>
   <h4>PrintToPage</h4> <s></s>
</div>
If set, ends printing by this page (including it).<br />

<!-- ShowPrintPageBreaks -->
<a name="CfgShowPrintPageBreaks"></a>
<div class="XML">
   <u>new <b>15.0</b></u> <b>&lt;Cfg></b> <i>int</i>
   <h4>ShowPrintPageBreaks</h4> <s>[0] Saved to cookies, to not save it set ShowPrintPageBreaksLap='1'</s>
</div>
If it can show page breaks in (not printed) grid to mark which row / columns will be printed to which page.<br />
<b>-1</b> - The page breaks are hidden and cannot be shown.<br />
<b>0</b> - The page breaks are hidden and can be shown.<br />
<b>1</b> - The page breaks are shown and can be hidden. Can slow updating large grids.<br />

<!----------------------------------------------------------------------- Print API -------------------------------------------------------------------->
<a name="API"></a>
<h2>Print API</h2>

<!-- Action Print -->
<a name="ActionsPrint"></a>
<div class="ACT">
   <u></u> <b>&lt;Actions></b> <i></i>
   <h4>Print</h4>
   <s>Attached to event <b>OnClickButtonPrint</b></s>
</div>
Shows printable version or grid and displays dialog for printing.<br />

<!-- OnPrintStart -->
<a name="OnPrintStart"></a>
<div class="API">
   <u>new <b>6.0</b></u> <b>API event</b> <i>bool</i>
   <h4>OnPrintStart</h4>
   <s>(<i>TGrid</i> <b>grid</b>)</s>
</div>
Called before the print report is generated.<br /> 
Return true to cancel printing.<br />

<!-- OnPrintInit -->
<a name="OnPrintInit"></a>
<div class="API">
   <u>new <b>7.1</b> <i>upd <b>12.1</b></i></u> <b>API event</b> <i>void</i>
   <h4>OnPrintInit</h4>
   <s>(<i>TGrid</i> <b>grid</b>, <i>string[Name]</i> <b>Cols</b>, <i>string[id]</i> <b>Rows</b>)</s>
</div>
Called after users selected columns to print and before the print report is generated.<br /> 
<b>Cols</b> is array of all columns to print, by column name. If the column is not listed, it is <u>not</u> printed.<br />
<b>Rows</b> <i>(new 12.1)</i> is array of rows to print, by row id. If the row is not listed, it is printed according to its <a href="#ICanPrint">CanPrint</a> value.<br />
It is possible to modify these arrays. They are null when set <tt><a href="#CfgPrintCols">PrintCols</a> = 0</tt>.<br />
Other settings like rows per page are already read from configuration and can be modified in the grid attributes.<br />
Here is possible to modify also <a href="#CfgPrintCount">PrintCount</a> attribute when printing in server paging.<br />

<!-- OnPrint -->
<a name="OnPrint"></a>
<div class="API">
   <u>chg <b>6.0</b></u> <b>API event</b> <i>string</i>
   <h4>OnPrint</h4>
   <s>(<i>TGrid</i> <b>grid</b>, <i>Window</i> <b>window</b>, <i>string</i> <b>report</b>)</s>
</div>
Called after the print report has been generated, but before it was written to the print window and printed.<br />
Return true to cancel printing or own print.<br /> 
Or return new or updated report to print.<br />
<b>window</b> is new window created for printing and should be closed when OnPrint returns true.<br />
<b>report</b> is the generated grid HTML that will be printed.<br />

<!-- OnPrintFinish -->
<a name="OnPrintFinish"></a>
<div class="API">
   <u></u> <b>API event</b> <i>bool</i>
   <h4>OnPrintFinish</h4>
   <s>(<i>TGrid</i> <b>grid</b>, <i>Window</i> <b>window</b>)</s>
</div>
Called after print report is written to the window and before the printing dialog is displayed.<br />
<b>window</b> is browser's window that contains the report.<br />
You can also use this event to get back changes you done in <a href="#OnPrintStart">OnPrintStart</a> event, if any.<br />
Return true to suppress default action. You can call here window.print() in this event and do some action after, for example to close the window.<br />

<!-- OnPrintClose -->
<a name="OnPrintClose"></a>
<div class="API">
   <u>new <b>7.1</b></u> <b>API event</b> <i>void</i>
   <h4>OnPrintClose</h4>
   <s>(<i>TGrid</i> <b>grid</b>, <i>Window</i> <b>window</b>)</s>
</div>
Called when the print window is being closed or the print report is to be deleted and the original grid restored (depends on <a href="#CfgPrintLocation">PrintLocation</a> settings).<br />
<b>window</b> is browser's window that contains the report.<br />
Here you can take back changes you done in page in OnPrintFinish, especially for <a href="#CfgPrintLocation">PrintLocation</a> >= 2.<br />

<!-- OnPrintEmpty -->
<a name="OnPrintEmpty"></a>
<div class="API">
   <u>new <b>14.0</b></u> <b>API event</b> <i>void</i>
   <h4>OnPrintEmpty</h4>
   <s>(<i>TGrid</i> <b>grid</b>)</s>
</div>
Called if here is nothing to print - the <a href="#CfgPrintFromPage">PrintFromPage</a>, <a href="#CfgPrintToPage">PrintToPage</a> range is outside the actual pages.<br />

<!-- OnGetHtmlValue -->
<a name="OnGetHtmlValue"></a>
<div class="API">
   <u></u> <b>API event</b> <i>string</i>
   <h4>OnGetHtmlValue</h4>
   <s>(<i>TGrid</i> <b>grid</b>, <i>TRow</i> <b>row</b>, <i>string</i> <b>col</b>, <i>type</i> <b>val</b>)</s>
</div>
Called to get formatted cell value to display. val is unformatted cell value.<br />
Returns formatted value. If returned value is <u>not null</u>, it is used instead of internal formatting by Format or Enum attributes.<br />
Return null to use default formatting behavior.<br />
It can be used also for printing, to print different value than cells show, for example:<br />
<tt>Grids.OnPrintStart = function(G)&#123; Grids.OnGetHtmlValueTmp = Grids.OnGetHtmlValue; Grids.OnGetHtmlValue = function(G,row,col,val)&#123; <i>/* here modify and return the values for printing */</i>   } }</tt><br />
<tt>Grids.OnPrint = function(G)&#123; Grids.OnGetHtmlValue = Grids.OnGetHtmlValueTmp; }</tt><br />

<!-- GetPrintable -->
<a name="GetPrintable"></a>
<div class="API">
   <u>chg <b>6.0</b></u> <b>API method</b> <i>string</i>
   <h4>GetPrintable</h4>
   <s>(<i>function</i> <b>func</b>)</s>
</div>
Generates print report for the grid.<br />
If <b>func</b> is <u>not</u> set, it generates the report synchronously without displaying message and returns the generated report.<br />
If <b>func</b> is set, it generates the report asynchronously, shows and updates progress message and after finish calls <b>func</b> (<i>report</i>).<br />

</div>
</body>	
</html>